package interview.ispalindrome;

public class IsPalindrome {
	public boolean isPalindrome(int x) {
		int leftMask = 1 << 31;
		int rightMask = 1;
		for(int i = 0; i < 16; i++) {
			if((x & leftMask) == 0 && (x & rightMask) > 0) {
				return false;
			} else if ((x & leftMask) > 0 && (x & rightMask) == 0) {
				return false;
			}
		}
		
		return true;
	}
}
